/* --- FUNCTION WinVnInit ---------------------------------------------
*
* Initialize the program (first stage).
* This routine does some initialization needed before the
* creation of the main window.
* I put off additional initialization until after the main
* window is created.
*
* Entry hInstance is a handle to the current instance of
* execution.
*
* Exit Window classes have been registered, and a small
* amount of other window- and comm-related initialization
* is done.
*/
BOOL
WinVnInit (hInstance)
HANDLE hInstance;
{
HANDLE hMemory;
PWNDCLASS pWndClass;
char mesbuf[60], mesbuf2[60];
char buf[60];
char *errptr;
char *env_var;
BOOL bSuccess;
Initializing = INIT_READING_NEWSRC;
SaveNewsrc = TRUE;
CommLineLWAp1 = CommLineIn + MAXCOMMLINE;
LineHeight = 30; /* kludge so Net window doesn't get divide-by-zero */
#ifndef MAC
szAppName = "WinVN";
env_var = getenv ("WINVN"); /* get path to winvn.ini */
if (lstrlen (env_var))
{
lstrcpy (szAppProFile, env_var);
if (*(szAppProFile + lstrlen (szAppProFile) - 1) == '\\')
lstrcat (szAppProFile, "winvn.ini");
else
lstrcat (szAppProFile, "\\winvn.ini");
}
else
{
MessageBox (hWndConf,"Environment variable WINVN not set.\nWINVN must point to your login directory\nto find your WINVN.INI and NEWSRC\nThis is done automatically if you are logged in\nor you can type \"SET WINVN=N:\\WINVN\"","Fatal Error", MB_OK | MB_ICONEXCLAMATION);